Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Find-JiraFilter #365

Merged
merged 9 commits into from
Aug 15, 2019
Merged

Find-JiraFilter #365

merged 9 commits into from
Aug 15, 2019

Conversation

vercellone
Copy link

Description

Adds a Find-JiraFilter function to facilitate finding filters by name (among other things) when the Id is not known. The relevant rest api endpoint is /rest/api/3/filter/search.

Motivation and Context

Get-JiraFilter lacks the ability to retrieve a filter by name, and the performance of its' -Favorite switch is inadequate for large result sets.

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist

  • My code follows the code style of this project.
  • I have added Pester Tests that describe what my changes should do.
  • I have updated the documentation accordingly.

@vercellone vercellone requested review from a team as code owners July 28, 2019 04:56
@lipkau
Copy link
Member

lipkau commented Jul 28, 2019

Hi @vercellone

Thank you very much for this contribution!

Please allow me a few days to think about this, as it's the first use of an API which is new with version 3 🎉
I don't know yet how to handle the error scenario on a server that does not support v3 yet.

Some question to you, though:
Is it a conscious decision not to have any parameter support the pipeline? Or list input for that matter.
Also, why not allow for project keys to be passed to the function?

@vercellone
Copy link
Author

I did avoid less objective features pending feedback. But, I can implement those.

  1. How should -Sort be handled for Name list and pipeline scenarios considering that some sort properties may not be included in the responses?

@vercellone
Copy link
Author

Evidently, the endpoint is unchanged from v2 to v3. 2, 3, and latest all work. So, the currently coded Uri should be fine as-is:
$searchURi = "$server/rest/api/latest/filter/search"

JiraPS/Public/Find-JiraFilter.ps1 Show resolved Hide resolved
JiraPS/Public/Find-JiraFilter.ps1 Outdated Show resolved Hide resolved
JiraPS/Public/Find-JiraFilter.ps1 Outdated Show resolved Hide resolved
JiraPS/Public/Find-JiraFilter.ps1 Outdated Show resolved Hide resolved
docs/en-US/commands/Find-JiraFilter.md Show resolved Hide resolved
docs/en-US/commands/Find-JiraFilter.md Outdated Show resolved Hide resolved
docs/en-US/commands/Find-JiraFilter.md Outdated Show resolved Hide resolved
docs/en-US/commands/Find-JiraFilter.md Outdated Show resolved Hide resolved
docs/en-US/commands/Find-JiraFilter.md Show resolved Hide resolved
@lipkau
Copy link
Member

lipkau commented Aug 10, 2019

I tested this api on

  • Jira v7.13.5 (not cloud) 👎
  • Jira 4cb60bea (cloud) 👍

it's not part of the Jira Server 8 Api doc.

The error return when the API does not exist was

Invoke-JiraMethod : Server responsed with NotFound

this might be relevant to refactor with a "Not supported by server" error once the module has better responses

@lipkau lipkau added this to the v2.11 milestone Aug 10, 2019
@lipkau lipkau changed the base branch from master to develop August 15, 2019 13:51
@lipkau lipkau merged commit e23a63b into AtlassianPS:develop Aug 15, 2019
@vercellone vercellone deleted the findjirafilter branch August 15, 2019 15:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants